package com.abel.util;

import java.util.List;

import com.abel.domain.UserRole;
import com.abel.domain.UserSession;

public class UserSessionLocator {

	
	@SuppressWarnings("rawtypes")
	private static ThreadLocal threadLocal = new ThreadLocal();
	
	/**
	 * 
	 * @return
	 */
	public static UserSession getUserSession() {
		return (UserSession)threadLocal.get();
	}
	
	/**
	 * 
	 * @param userSession
	 */
	
	@SuppressWarnings("unchecked")
	public static void setUserSession(UserSession userSession) {
		threadLocal.set(userSession);
	}
	
	public static void invalidateUserSession() {
		threadLocal.remove();
	}
}
